<x-layout>
    <style>
        .title{
            margin-top:2em;
        }

        .padding-big{
            margin:2em 0em;
        }

        #location{
            margin:1em 0em;
        }
    </style>
    <div class="panel">
        <div class="text-center">
            <h2 class="title">
                <stong>{{$message}}</stong><br />
                <p id="location"><span id="notice">3</span>秒后自动跳转界面</p>
            </h2>
            <div>
                @if($result)
                    <div class="float-left"> 
                        <img src="{{URL::asset('assets/images/404/left.gif')}}" alt="" />
                    </div>
                @else
                    <div class="float-right"> 
                        <img src="{{URL::asset('assets/images/404/right.png')}}" width="260" class="hidden-xs" alt="" /> 
                    </div>
                @endif
            </div>
            <div class="padding-big"> 
                <a href="{{url('/')}}" class="btn btn-primary">返回首页</a> 
                @if($url)
                    <a href="{{url($url)}}" class="btn btn-primary">跳转界面</a> 
                @else
                    <a href="javascript:history.go(-1)" class="btn btn-primary">跳转界面</a> 
                @endif
                
            </div>
        </div>
    </div>

    <script>
        var url = '{{$url}}'

        var T = setInterval(function(){
            var notice = document.getElementById('notice')

            var sec = notice.innerHTML

            if(sec > 0)
            {
                notice.innerHTML = sec-1
            }else
            {
                clearInterval(T)
                if(url)
                {
                    location.href = url
                }else
                {
                    history.go(-1)
                }
            }

        }, 1000)
    </script>
</x-layout>